#! /bin/bash

function color_echo()
{
    while (($#!=0))
    do
            case $1 in
                    -b)
                            echo -ne " ";
                    ;;
                    -t)
                            echo -ne "\t";
                    ;;
                    -n)     echo -ne "\n";
                    ;;
                    -black)
                            echo -ne "\033[30m";
                    ;;
                    -red)
                            echo -ne "\033[31m";
                    ;;
                    -green)
                            echo -ne "\033[32m";
                    ;;
                    -yellow)
                            echo -ne "\033[33m";
                    ;;
                    -blue)
                            echo -ne "\033[34m";
                    ;;
                    -purple)
                            echo -ne "\033[35m";
                    ;;
                    -cyan)
                            echo -ne "\033[36m";
                    ;;
                    -white|-gray) echo -ne "\033[37m";
                    ;;
                    -reset)
                            echo -ne "\033[0m";
                    ;;
                    -h|-help|--help)
                            echo "Usage: color_echo -color1 message1 -color2 message2 ...";
                            echo "eg:       color_echo -red [ -blue message1 message2 -red ]";
                    ;;
                    *)
                    echo -ne "$1"
                    ;;
            esac
            shift
    done
}



## 1. Network Connect
# wifi iwctl 
# iwctl 
# station device connect xxxxx

# dhcpcd start
# systemctl start dhcpcd


## 2. generate pacman Mirrors
color_echo -green "Generated Latest 10 speed rate pacman mirrorlist\n" -reset
reflector -c China -a 10 --sort rate --save /etc/pacman.d/mirrorlist
color_echo -yellow
cat /etc/pacman.d/mirrorlist

color_echo -green "Install git git-crypt dmidecode\n" -reset
pacman -Sy git git-crypt dmidecode --noconfirm
color_echo -green "git clone https://gitee.com/ykzhai/ArchLinux.git\n" -reset
git clone https://gitee.com/ykzhai/ArchLinux.git  --depth 1

## 3. Disk Parttions
# cfdisk 分区 


## 4. Install Basic Softs


## 5. Install 
